package messangerTypes;

@SuppressWarnings("serial")
public class User implements java.io.Serializable
{
	private int id = 0;
	private String nameLast = null;
	private String nameFirst = null;
	private String password = null;
	
	/*
	public User()
	{
		
	}
	*/
	public User(String firstName, String lastName, int ID, String password)
	{
		setNameFirst(firstName);
		setNameLast(lastName);
		setId(ID);
		setPassword(password);
	}

	@Override
	public String toString()
	{
		return this.getName();
	}

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public String getNameLast()
	{
		return nameLast;
	}

	public void setNameLast(String nameLast)
	{
		this.nameLast = nameLast;
	}

	public String getNameFirst()
	{
		return nameFirst;
	}

	public void setNameFirst(String nameFirst)
	{
		this.nameFirst = nameFirst;
	}
	
	public String getName ()
	{
		return nameFirst + " " + nameLast;
	}
	
	public boolean equals (User user)
	{
		if (user != null &&
				user.getNameFirst().contentEquals(this.nameFirst)&&
				user.getNameLast().contentEquals(this.nameLast))
		{
			return true;
		}
		else 
		{
			return false;
		}
	}

	public String getPassword()
	{
		return password;
	}

	public void setPassword(String password)
	{
		this.password = password;
	}
}
